package JDBC;
import java.io.UnsupportedEncodingException;
import java.sql.*;

import javax.activation.DataSource;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
	public static final String url = "jdbc:mysql://127.0.0.1/RUNOOD?characterEncoding=UTF-8";  //用到的数据库名
	public static final String name = "com.mysql.jdbc.Driver"; //驱动名
	public static final String user = "root";
	public static final String password = "123456";
	
	public static void main(String[] args) throws ClassNotFoundException, UnsupportedEncodingException {
		Class.forName(name); //注册驱动

		ApplicationContext context = new ClassPathXmlApplicationContext("jdbc_application1.xml");
		JDBCPersonDao dao = (JDBCPersonDao)context.getBean("personDao");
			
		dao.findUserByName("小明");
//		dao.insert("小刚", "21");

	}
}
